package com.example.order.domain.dto;

import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CreateOrderDTO {

    @NotNull(message = "支付方式不能为空")
    @Range(min = 1, max = 3, message = "支付方式范围1-3（1=微信, 2=支付宝, 3=银行卡）")
    private Integer paymentType;

    @NotNull(message = "收货地址不能为空")
    @Positive(message = "地址ID必须为正整数")
    private Integer addressId;

    @Size(max = 200, message = "留言长度不能超过200字符")
    private String buyerMessage;

    @NotEmpty(message = "商品列表不能为空")
    private List<GoodsDTO> goods;

}
